package cn.com.sixboy.service.base;

import cn.com.sixboy.cache.Cache;
import cn.com.sixboy.dao.QueryConditionEntity;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

/**
 * @author Sam.Zheng <zcl1866@sina.com>
 * @date 2013-4-25 16:30:09
 * @version <v0.1>
 * @copyright SixBoy
 */
public interface BaseService<T> {
	public boolean add(T entity);

	public boolean delete(T entity);

	public boolean update(T entity);

	public T querySingleEntity(Class c, int primaryKey);

	public List queryListEntitiesByOneParam(String jpql, String param,
			Object value);

	public T queryEntityByOneParam(String jpql, String param, String value);

	public List queryEntitiesByNativeSQL(String nativeSql, Class<?> type);

	public List<T> queryAllEntity(String jpql, boolean isNameQuery);

	public boolean removeBetchEntity(List<T> entities);

	public boolean updateBatchEntity(List<T> entities);

	public List<T> queryEntities(QueryConditionEntity qce, boolean isNameQuery);
        
        public void clear();
        
        public Object getCacheData(String key);
        public void setCacheData(String key,Object data);
}
